﻿<Page x:Class="PasswordProvider.View.SecurityOptionsPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    
    xmlns:lib="clr-namespace:PasswordProvider.View.Library"
    xmlns:behavior="clr-namespace:PasswordProvider.View.Behaviors"
    Title="{Binding DisplayName}"
    ToolTip="{Binding ToolTip}"
    >
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <GroupBox Margin="10,5,10,0" Height="125" VerticalAlignment="Top"
                  Header="{Binding AuthenticationInvalidationMethod.DisplayName}">
            <StackPanel>
                <lib:EnumSelector EnumValue="{Binding AuthenticationInvalidationMethod.EnumValue}">
                    <lib:EnumSelectorDisplayItem
                        DisplayName="{behavior:StringBinding AuthenticationInvalidationMethod.DisplayItems[0].DisplayName}"
                        ToolTip="{behavior:StringBinding AuthenticationInvalidationMethod.DisplayItems[0].ToolTip}"
                        EnumValue="{behavior:EnumBinding AuthenticationInvalidationMethod.DisplayItems[0].EnumValue}" />
                    <lib:EnumSelectorDisplayItem
                        DisplayName="{behavior:StringBinding AuthenticationInvalidationMethod.DisplayItems[1].DisplayName}"
                        ToolTip="{behavior:StringBinding AuthenticationInvalidationMethod.DisplayItems[1].ToolTip}"
                        EnumValue="{behavior:EnumBinding AuthenticationInvalidationMethod.DisplayItems[1].EnumValue}" />
                    <lib:EnumSelectorDisplayItem
                        DisplayName="{behavior:StringBinding AuthenticationInvalidationMethod.DisplayItems[2].DisplayName}"
                        ToolTip="{behavior:StringBinding AuthenticationInvalidationMethod.DisplayItems[2].ToolTip}"
                        EnumValue="{behavior:EnumBinding AuthenticationInvalidationMethod.DisplayItems[2].EnumValue}" />                    
                </lib:EnumSelector>

                <WrapPanel Margin="15,0,0,0" IsEnabled="{Binding ValidationTimeoutMinutes.IsEnabled}">
                    <Label Content="{Binding ValidationTimeoutMinutes.DisplayName}" />
                    <TextBox Width="30" Height="20" 
                             Text="{Binding ValidationTimeoutMinutes.Text}"/>
                </WrapPanel>

            </StackPanel>
        </GroupBox>
        
        <CheckBox Grid.Row="1" Margin="17,15,0,0" VerticalAlignment="Top"
                  IsChecked="{Binding EncryptDataFile.IsChecked}" 
                  Content="{Binding EncryptDataFile.DisplayName}" 
                  ToolTip="{Binding EncryptDataFile.ToolTip}" />
    </Grid>
</Page>
